<!--
  - Copyright(c)  2022 厦门外里科技有限公司 All rights reserved.
  -
  - https://www.wailikeji.com
  -
  - 版权所有，侵权必究！
  -->

<template>
	<view>
		<!--		<u-navbar title-color="#020202" :background="{background:'#f8f8f8'}" title="客服">-->
		<!--		</u-navbar>-->
		<web-view :src="url" :progress="false"></web-view>
	</view>
</template>

<script>
	import {
		API_URL
	} from '@/env'
	export default {
		data() {
			return {
				baseUrl: API_URL,
				url: '',
				title: '客服'
			}
		},
		onLoad() {
			if (this.$store.state.user.userInfo) {
				let tempUrl = "https://kefu.wailikeji.com/chat/index?noCanClose=1&token=4326be5eebbfa630806ba23b6ebad45b"+
					"&uid=" + this.$store.state.user.userInfo.userId +
					"&nickName=" + this.$store.state.user.userInfo.username +
					"&phone=" + this.$store.state.user.userInfo.phone
					// "&sex=" + (this.$store.state.user.userInfo.sex == 0 ? '女' : '男')
					// "&avatar=" + this.baseUrl+this.$store.state.user.userInfo.userAvatar
					console.log("url="+tempUrl)
				this.url = decodeURIComponent(
					tempUrl
				);
			}
		},
		onReady() {
			uni.setNavigationBarTitle({
				title: this.title
			})
		}
	}
</script>
